import { defHttp } from '/@/utils/http/axios'
import { ProjectBO, ProjectListResult, ProjectSO } from './model/projectModel'
import { BasicFetchResult, BasicPageParams, BasicQueryModel } from '/@/api/model/baseModel'

enum Api {
  pageProject = '/project/page',
  listProject = '/project/list',
  createProject = '/project/create',
}

export const pageProject = (data: BasicPageParams<ProjectSO>) => {
  return defHttp.post<BasicFetchResult<ProjectListResult>>({ url: Api.pageProject, data })
}

export const createProject = (data: ProjectBO) => {
  return defHttp.post<Boolean>({ url: Api.createProject, data })
}

export const listProject = (params: string | undefined) => {
  return defHttp.get<ProjectListResult[]>({
    url: Api.listProject,
    params: { tenantId: params },
  })
}
